﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVONCC
    {
        private int _MaNCC;
        private string _TenNCC;
        private string _DiaChi;
        private string _DienThoai;
        private string _Email;

        public UserVONCC(int MaNCC, string TenNCC, string DiaChi, string DienThoai, string Email)
        {
            this._MaNCC = MaNCC;
            this._TenNCC = TenNCC;
            this._DiaChi = DiaChi;
            this._DienThoai = DienThoai;
            this._Email = Email;
        }

        public int MANHACUNGCAP
        {
            get { return _MaNCC; }
            set { _MaNCC = value; }
        }

        public string TENNHACUNGCAP
        {
            get { return _TenNCC; }
            set { _TenNCC = value; }
        }

        public string DIACHI
        {
            get { return _DiaChi; }
            set { _DiaChi = value; }
        }

        public string DIENTHOAI
        {
            get { return _DienThoai; }
            set { _DienThoai = value; }
        }

        public string EMAIL
        {
            get { return _Email; }
            set { _Email = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaNCC = dr.IsNull(0) ? 0 : Convert.ToInt32(dr[0]);
                this._TenNCC = dr.IsNull(1) ? string.Empty : Convert.ToString(dr[1]);
                this._DiaChi = dr.IsNull(2) ? string.Empty : Convert.ToString(dr[2]);
                this._DienThoai = dr.IsNull(3) ? string.Empty : Convert.ToString(dr[3]);
                this._Email = dr.IsNull(4) ? string.Empty : Convert.ToString(dr[3]);
            }
        }
    }
}
